const { load, save, remove, STORAGE_KEYS } = require('./storage.js')

function getCurrentUser() {
  return load(STORAGE_KEYS.currentUser, null)
}

function setCurrentUser(user) {
  save(STORAGE_KEYS.currentUser, user)
}

function logout() {
  remove(STORAGE_KEYS.currentUser)
}

module.exports = {
  getCurrentUser,
  setCurrentUser,
  logout
}
